libxl: Fix leaks on context init failure
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 13 Jan 2012 16:54:27 +0000 (16:54 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 13 Jan 2012 16:54:27 +0000 (16:54 +0000)
commita54239be9af2a50e9e849e3f7da8193256ad39bc
tree1edfe7fe7d7852306a1e0a1735853170ff537d50
parent2fe29aed9d328641cdc50ffdb013193883bf2f0a
libxl: Fix leaks on context init failure

Several of the error exits from libxl_ctx_alloc leaked the context
struct itself and sometimes other resources too.

Fix this by using the standard "rc = ERROR_FOO; goto out" error
handling style throughout.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/libxl.c